{% extends 'base.html' %}

{% block  title%}
数据操作页面
{% endblock %}

{% block sidebar%}
    <aside id="sidebar" class="sidebar">

    <ul class="sidebar-nav" id="sidebar-nav">
      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'home' %}">
          <i class="bi bi-grid"></i>
          <span>首页</span>
        </a>
      </li>
      <li class="nav-heading">个人信息</li>
      <li class="nav-item">
        <a class="nav-link collapsed"  href="{% url 'changeSelfInfo' %}">
          <i class="bi bi-menu-button-wide"></i><span>个人信息</span></i>
        </a>
      </li><!-- End Components Nav -->

      <li class="nav-item">
        <a class="nav-link collapsed"  href="{% url 'changePassword' %}">
          <i class="bi bi-journal-text"></i><span>修改密码</span>
        </a>
      </li>
      <li class="nav-heading">数据表格</li>

      <li class="nav-item">
        <a class="nav-link " href="{% url 'tableData' %}">
          <i class="bi bi-layout-text-window-reverse"></i><span>数据操作</span>
        </a>
      </li>
      <li class="nav-heading">数据可视化</li>

      <li class="nav-item">
        <a class="nav-link collapsed"  href="{% url 'cityChar' %}">
          <i class="bi bi-bar-chart"></i><span>城市和景点等级分析</span></i>
        </a>
      </li>

      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'rateChar' %}">
          <i class="bi bi-gem"></i><span>评分情况分析</span>
        </a>
      </li><!-- End Icons Nav -->

      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'priceChar' %}">
          <i class="bi bi-person"></i>
          <span>价格销量分析</span>
        </a>
      </li>

      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'commentsChar' %}">
          <i class="bi bi-question-circle"></i>
          <span>评论分析</span>
        </a>
      </li>
      <li class="nav-heading">词云图</li>

      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'detailIntroCloud' %}">
          <i class="bi bi-card-list"></i>
          <span>详情简介词云图</span>
        </a>

      <li class="nav-item">
        <a class="nav-link collapsed" href="{% url 'commentContentCloud' %}">
          <i class="bi bi-box-arrow-in-right"></i>
          <span>评论内容词云图</span>
        </a>
      </li>

      <li class="nav-heading">后台管理</li>
      <li class="nav-item">
        <a class="nav-link collapsed" href="http://127.0.0.1:8000/admin/">
          <i class="bi bi-envelope"></i>
          <span>后台数据管理</span>
        </a>
      </li>
    </ul>

  </aside>

{% endblock %}


{% block content %}
      <div class="pagetitle" style="display: flex;align-items: center">
      <div style="margin-right: auto">
          <h1>数据操作</h1>
        <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="{% url 'home' %}">数据表格</a></li>
          <li class="breadcrumb-item active">数据操作页面</li>
        </ol>
      </nav>
      </div>
        <h5 style="font-weight: normal">
            {{ nowTime.year }} - {{ nowTime.mon }} - {{ nowTime.day }}
        </h5>
    </div>

<!--            数据展示-->

            <section class="section dashboard">
              <div class="row">
                <div class="col-lg-12">
                  <div class="card recent-sales overflow-auto">
                    <div class="card-body">
                      <h5 class="card-title">景点数据表格</h5>

                      <table class="table table-borderless datatable">
                        <thead>
                          <tr>
                            <th scope="col">#</th>
                            <th  scope="col">景区名</th>
                            <th style="width:100px" scope="col">景区等级</th>
                            <th style="width:100px" scope="col">景区省份</th>
                            <th style="width:100px" scope="col">景区评分</th>
                            <th style="width:100px" scope="col">价格</th>
                            <th style="width:150px" scope="col">月销量</th>
                            <th style="width:200px" scope="col">图片</th>
                            <th style="width:150px" scope="col">操作</th>
                          </tr>
                        </thead>

                        <tbody>
                          {% for i in talbeData %}
                            <tr>
                                <th scope="row">
                                    <a href="#">{{ i.id }}</a>
                                </th>
                                <td>{{ i.title }}</td>
                                <td><a href="#">{{ i.level }}</a></td>
                                <td>{{ i.province }}</td>
                                <td><span class="badge bg-success">{{ i.score }}分</span></td>
                                <td style="color:orange">${{ i.price }}元</td>
                                <td>{{ i.saleCount }}/月销量</td>
                                <td>
                                    <a href="{{ i.detailUrl }}">
                                         <img style="width:100%" src="{{ i.cover }}" alt="">
                                    </a>
                                </td>
                                <td style="text-align:center;line-height: 70px">
                                    <a href="{% url 'addComments' i.id %}" class="btn btn-primary waves-effect waves-light">添加评论</a>
                                </td>
                              </tr>
                        {% endfor %}
                        </tbody>

                      </table>
                      <!-- End Table with stripped rows -->

                    </div>
                  </div>

                </div>

              </div>
            </section>



{% endblock %}

{% block echarts%}
    <script>

    </script>
{% endblock %}